package ;

import Counter;

/**
 * ...
 * @author 
 */

class JagCounters 
{
	public var Score: Counter;
	public var ScoreBonus: Counter;

	public var Items: Array<Counter>;
	public var maxItems: Int;
	
	public var Time: TimeCounter;
	

	public function new() 
	{
		Score = new Counter();
		ScoreBonus = new Counter();
		
		Items = new Array<Counter>();
		maxItems = 0;
		
		for (i in 0...JagTileInfo.ItemMax) {
			Items.push(new Counter());
		}
		
		Time = new TimeCounter(1000, 0, 0);
		
		Reset();
	}
	
	
	public function Reset()
	{		
		Score.Set(0);
		ScoreBonus.Set(1);
		
		for (i in Items) {
			i.Set(0);
		}
	}
	
	
	public function SetMaxItems(v: Int)
	{
		maxItems = v;
	}

	
	public function CountItem(id: Int, v: Int)
	{
		var key = id - JagTileInfo.Item1;
		Items[key].Add(v);
	}
	
}